package day06;

import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/testServletContext")
public class TestServletContextServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("TestServletContextServlet.service()");

        ServletContext application=getServletContext();

//        ServletContext application=request.getServletContext();

//        ServletContext application=request.getSession().getServletContext();

//        String aaa=application.getInitParameter("aaa");
//
//        System.out.println("aaa = " + aaa);

        
        
        String realPath=application.getRealPath(".");
        System.out.println("realPath = " + realPath);
        
        realPath=application.getRealPath("js/jquery-3.3.1.min.js");

        System.out.println("realPath = " + realPath);
        
        
        
    }
}
